package lgs.hm.mapper;

import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import lgs.hm.model.Employee;

@Mapper  //通过Mapper找数据库  
public interface EmployeeMapper {//虽然是接口但是不需要实现类，通过动态代理来实现
	                             //mybatis找到的动态代理对象
	
	public List<Employee> findAllEmp();
	public List<Employee> findAll8(@Param("number")Integer number);
	
	public boolean insertEmp(Employee employee);
	public boolean updateEmp(Employee employee);
	
	public boolean deleteEmp(Integer min,Integer max);
	
//	@Select("select * from employee")  
//	public List<Map<String, Object>> findAll();//List(Map<String, Object> map)
	public List<Employee> findAll();
	
	public List<Employee> select();
	
	public Employee findById(int id);
	
//	@Insert("insert into employee(u_name,u_phone,u_age,u_salary) values(#{name},#{phone},#{age},#{salary})")
	                                                                    //通过#占位符拿，对应map里面的key
//	public Boolean insert(Map<String, Object> map);
    public boolean insert(Employee employee);
	
//	@Update("update employee set u_name=#{name},u_phone=#{phone},u_age=#{age},u_salary=#{salary} where id=#{id}")
//	public Boolean update(Map<String, Object> map);
	public boolean update(Employee employee);
	
//	@Delete("delete from employee where id=#{id}")
//	public Boolean delet(Map<String,Object> map);
	public boolean delet(Employee employee);

	public List<Employee> findAllTwo();
	
	

}
